package com.cisystem.system.service.impl;

import java.util.List;

import com.cisystem.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cisystem.system.mapper.FileViewRecordMapper;
import com.cisystem.system.domain.FileViewRecord;
import com.cisystem.system.service.IFileViewRecordService;

/**
 * 文件浏览记录Service业务层处理
 *
 * @author xxx
 * @date 2024-08-03
 */
@Service
public class FileViewRecordServiceImpl implements IFileViewRecordService {
    @Autowired
    private FileViewRecordMapper fileViewRecordMapper;

    /**
     * 查询文件浏览记录
     *
     * @param id 文件浏览记录主键
     * @return 文件浏览记录
     */
    @Override
    public FileViewRecord selectFileViewRecordById(String id) {
        return fileViewRecordMapper.selectFileViewRecordById(id);
    }

    /**
     * 查询文件浏览记录列表
     *
     * @param fileViewRecord 文件浏览记录
     * @return 文件浏览记录
     */
    @Override
    public List<FileViewRecord> selectFileViewRecordList(FileViewRecord fileViewRecord) {
        return fileViewRecordMapper.selectFileViewRecordList(fileViewRecord);
    }

    /**
     * 新增文件浏览记录
     *
     * @param fileViewRecord 文件浏览记录
     * @return 结果
     */
    @Override
    public int insertFileViewRecord(FileViewRecord fileViewRecord) {
        fileViewRecord.setCreateTime(DateUtils.getNowDate());
        return fileViewRecordMapper.insertFileViewRecord(fileViewRecord);
    }

    /**
     * 修改文件浏览记录
     *
     * @param fileViewRecord 文件浏览记录
     * @return 结果
     */
    @Override
    public int updateFileViewRecord(FileViewRecord fileViewRecord) {
        fileViewRecord.setUpdateTime(DateUtils.getNowDate());
        return fileViewRecordMapper.updateFileViewRecord(fileViewRecord);
    }

    /**
     * 批量删除文件浏览记录
     *
     * @param ids 需要删除的文件浏览记录主键
     * @return 结果
     */
    @Override
    public int deleteFileViewRecordByIds(String[] ids) {
        return fileViewRecordMapper.deleteFileViewRecordByIds(ids);
    }

    /**
     * 删除文件浏览记录信息
     *
     * @param id 文件浏览记录主键
     * @return 结果
     */
    @Override
    public int deleteFileViewRecordById(String id) {
        return fileViewRecordMapper.deleteFileViewRecordById(id);
    }

    @Override
    public int batchInsertFileViewRecord(List<FileViewRecord> fileViewRecordList) {
        return fileViewRecordMapper.batchInsertFileViewRecord(fileViewRecordList);
    }
}
